package com.pengchuang.ACS.common.utils;

import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;

/**
 * @description:
 * @projectName: AccessControlSystem
 * @see: com.pengchuang.ACS.common.utils
 * @author: pc
 * @createTime: 2023/3/12 19:50
 * @version: 1.0
 */
@Slf4j
public class FeignUtil {
	/**
	 * @Description: 将数据转换到相应的容器
	 * @return
	 * @throws
	 */
	public static <T> T convertValue(Object bean, Class<T> clazz){
		try{
			ObjectMapper mapper = new ObjectMapper();
			return mapper.convertValue(bean, clazz);
		}catch(Exception e){
			log.error("错误的转换：BeanUtil.convertValue() --->" + e.getMessage());
			return null;
		}
	}
}
